//
//  SNOrderFormListHeaderModel.m
//  app
//
//  Created by 王少宁 on 15/5/5.
//  Copyright (c) 2015年 hdaren. All rights reserved.
//  订单列表 headerView 的 model

#import "SNOrderFormListHeaderModel.h"

@implementation SNOrderFormListHeaderModel

- (instancetype)initwithDict:(NSDictionary *)dict
{
    if ([super init]) {
        _orderFormId = [dict[@"id"] intValue];
        _sn = dict[@"sn"];
        _receiver_name = dict[@"receiver_name"];
        _money = [NSString stringWithFormat:@"%.2f",[dict[@"money"] floatValue]];
        _createTime = dict[@"createTime"];
        _status = dict[@"status"];
        _isReturns = dict[@"isReturns"];
        
        NSMutableArray * mutableArray = [NSMutableArray array];
        NSArray * array = dict[@"product_info"];
        _productNum = array.count;
        for (NSDictionary * dic in array) {
            SNOrderFormListModel * model = [SNOrderFormListModel modelWithDict:dic];
            [mutableArray addObject:model];
        }
        _product_info = mutableArray;
    }
    return self;
}

+(instancetype)modelWithDict:(NSDictionary *)dict
{
    return [[self alloc] initwithDict:dict];
}

@end
